<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<jsp:include page="/common/commonCss.jsp"/>
<jsp:include page="/common/commonJs.jsp"/>
<script language="javascript" src="${basePath }commonJs/tags/My97DatePicker/WdatePicker.js"></script>
<script language="javascript" src="${basePath }commonJs/quinn_commons.js"></script>
<script type="text/javascript">
$(document).ready(function() {
	reprotTitle();
	$("#exportBtn").click(function() {
		$.messager.confirm('提示', '确定要导出吗？', function(r) {
			if (r) {
				$("#exportTime").val($("#searchTime").val());
				$("#exportForm").submit();
			}
		});
	});
	
	$("#searchBtn").click(function() {
		$("#searchForm").submit();
	});
});

function reprotTitle(){
	var time = $("#searchTime").val().replace('/','.');
	$("#reportTitle").html('<b>'+time+' 进场人数统计</b>');
}

function go() {
	window.location.href = "${basePath}report/jump.shtml?key=" + $("#report_type").val();
}
</script>
<title>Insert title here</title>
</head>
<body class="bg">

<div class="content m_auto">
	<%@include file="reprot_tab.jsp"%>
    <div class="content_r mt10">
    <div class="tab_normal m10">
    <div class="file_single_dl f14 fixed">
			<br />
			<form action="${basePath}report/jump.shtml" method="get" id="searchForm" name="searchForm">
			<dl style="overflow:hidden" class="fixed">
				<dd>
					<label>报表类型：</label>
					<div class="uboxstyle">
						<select name="reportName" id="report_type" onchange="go()">
							<option value="dailyIncome">日常收益报表</option>
							<option value="membershipSale">会籍销售统计报表</option>
							<option value="membership">会籍统计报表</option>
							<option value="partyOrGroup">派对团体统计报表</option>
							<option value="scmCount" selected = "selected">进场人数统计报表</option>
							<option value="membershipProfit">会籍利润报表</option>
							<option value="membershipValue">会员储值报表</option>
							<option value="partyPrepaid">派对预付报表</option>
							<option value="failureMember">会员失效报表</option>
						</select>
					</div>
				</dd>
				<dd><label>日期：</label>
					<input type="text" readonly="readonly" class="Wdate iput_t w82" onclick="WdatePicker({dateFmt:'yyyy.MM.dd ',isShowWeek:true,isShowClear:true,readOnly:true})" id="searchTime" name="searchTime" title="" value="${reportParam.searchTime }"/>
				</dd>
			</dl>
			</form>
			 <div>
            	<input type="button" id="searchBtn" class="btn fr m010" value="查询" onclick="select11();" />
            	<form action="${basePath}report/export.shtml" method="post" id="exportForm" name="exportForm">
            		<input type="hidden" name="reportName" value="scmCount"/>
            		<input type="hidden" name="searchTime" id="exportTime" />
            		<input type="button" id="exportBtn" class="btn fr m010"  value="导出" />
            	</form>
             </div>
		</div>
		<br />
    	
    <br />
    		<div id="reportTitle" style="text-align:center;font-size:18px;font-weight:blod;"></div><br />
			<div style="text-align:center;font-size:12px;font-weight:blod;"><b>统计时间：${countedTime} 统计人：${countedUser }</b></div><br />
			<div class="table_xg">
			<table class="table" id="table1">
				<tr>
					<td></td>
					<td>总进场人数</td>
					<td>儿童人数</td>
					<td>监护人人数</td>
					<td>09:00~10:00进场人数</td>
					<td>占比(单位%)</td>
					<td>10:00~11:00进场人数</td>
					<td>占比(单位%)</td>
					<td>11:00~12:00进场人数</td>
					<td>占比(单位%)</td>
					<td>12:00~13:00进场人数</td>
					<td>占比(单位%)</td>
					<td>13:00~14:00进场人数</td>
					<td>占比(单位%)</td>
					<td>14:00~15:00进场人数</td>
					<td>占比(单位%)</td>
					<td>15:00~16:00进场人数</td>
					<td>占比(单位%)</td>
					<td>16:00~17:00进场人数</td>
					<td>占比(单位%)</td>
					<td>17:00~18:00进场人数</td>
					<td>占比(单位%)</td>
					<td>18:00~19:00进场人数</td>
					<td>占比(单位%)</td>
					<td>19:00~20:00进场人数</td>
					<td>占比(单位%)</td>
					<td>20:00~21:00进场人数</td>
					<td>占比(单位%)</td>
					<td>21:00~22:00进场人数</td>
					<td>占比(单位%)</td>
				</tr>
				<c:forEach items="${reportParam.results }" var="count">
					<c:if test="${count.sumCount>0 }">
					<c:set var="sum1" value="${sum1+count.sumCount}"></c:set>
					<c:set var="sum2" value="${sum2+count.childCount}"></c:set>
					<c:set var="sum3" value="${sum3+count.guaCount}"></c:set>
					<c:set var="sum4" value="${sum4+count.count1}"></c:set>
					<c:set var="sum5" value="${(sum4/sum1)*100}"></c:set>
					<c:set var="sum6" value="${sum6+count.count2}"></c:set>
					<c:set var="sum7" value="${(sum6/sum1)*100}"></c:set>
					<c:set var="sum8" value="${sum8+count.count3}"></c:set>
					<c:set var="sum9" value="${(sum8/sum1)*100}"></c:set>
					<c:set var="sum10" value="${sum10+count.count4}"></c:set>
					<c:set var="sum11" value="${(sum10/sum1)*100}"></c:set>
					<c:set var="sum12" value="${sum12+count.count5}"></c:set>
					<c:set var="sum13" value="${(sum12/sum1)*100}"></c:set>
					<c:set var="sum14" value="${sum14+count.count6}"></c:set>
					<c:set var="sum15" value="${(sum14/sum1)*100}"></c:set>
					<c:set var="sum16" value="${sum16+count.count7}"></c:set>
					<c:set var="sum17" value="${(sum16/sum1)*100}"></c:set>
					<c:set var="sum18" value="${sum18+count.count8}"></c:set>
					<c:set var="sum19" value="${(sum18/sum1)*100}"></c:set>
					<c:set var="sum20" value="${sum20+count.count9}"></c:set>
					<c:set var="sum21" value="${(sum20/sum1)*100}"></c:set>
					<c:set var="sum22" value="${sum22+count.count10}"></c:set>
					<c:set var="sum23" value="${(sum22/sum1)*100}"></c:set>
					<c:set var="sum24" value="${sum24+count.count11}"></c:set>
					<c:set var="sum25" value="${(sum24/sum1)*100}"></c:set>
					<c:set var="sum26" value="${sum26+count.count12}"></c:set>
					<c:set var="sum27" value="${(sum26/sum1)*100}"></c:set>
					<c:set var="sum28" value="${sum28+count.count13}"></c:set>
					<c:set var="sum29" value="${(sum28/sum1)*100}"></c:set>
					<tr>
						<td>${count.name }</td>
						<td>${count.sumCount }</td>
						<td>${count.childCount }</td>
						<td>${count.guaCount }</td>
						<td>${count.count1 }</td>
						<td><fmt:formatNumber type="number" value="${(count.count1/count.sumCount)*100}" maxFractionDigits="2"/></td>
						<td>${count.count2 }</td>
						<td><fmt:formatNumber type="number" value="${(count.count2/count.sumCount)*100}" maxFractionDigits="2"/></td>
						<td>${count.count3 }</td>
						<td><fmt:formatNumber type="number" value="${(count.count3/count.sumCount)*100}" maxFractionDigits="2"/></td>
						<td>${count.count4 }</td>
						<td><fmt:formatNumber type="number" value="${(count.count4/count.sumCount)*100}" maxFractionDigits="2"/></td>
						<td>${count.count5 }</td>
						<td><fmt:formatNumber type="number" value="${(count.count5/count.sumCount)*100}" maxFractionDigits="2"/></td>
						<td>${count.count6 }</td>
						<td><fmt:formatNumber type="number" value="${(count.count6/count.sumCount)*100}" maxFractionDigits="2"/></td>
						<td>${count.count7 }</td>
						<td><fmt:formatNumber type="number" value="${(count.count7/count.sumCount)*100}" maxFractionDigits="2"/></td>
						<td>${count.count8 }</td>
						<td><fmt:formatNumber type="number" value="${(count.count8/count.sumCount)*100}" maxFractionDigits="2"/></td>
						<td>${count.count9 }</td>
						<td><fmt:formatNumber type="number" value="${(count.count9/count.sumCount)*100}" maxFractionDigits="2"/></td>
						<td>${count.count10 }</td>
						<td><fmt:formatNumber type="number" value="${(count.count10/count.sumCount)*100}" maxFractionDigits="2"/></td>
						<td>${count.count11 }</td>
						<td><fmt:formatNumber type="number" value="${(count.count11/count.sumCount)*100}" maxFractionDigits="2"/></td>
						<td>${count.count12 }</td>
						<td><fmt:formatNumber type="number" value="${(count.count12/count.sumCount)*100}" maxFractionDigits="2"/></td>
						<td>${count.count13 }</td>
						<td><fmt:formatNumber type="number" value="${(count.count13/count.sumCount)*100}" maxFractionDigits="2"/></td>
					</tr>
					</c:if>
				</c:forEach>
				<c:if test="${sum1>0 }">
					<tr>
						<td>合计</td>
						<td>${sum1 }</td>
						<td>${sum2 }</td>
						<td>${sum3 }</td>
						<td>${sum4 }</td>
						<td><fmt:formatNumber type="number" value="${sum5 }" maxFractionDigits="2"/></td>
						<td>${sum6 }</td>
						<td><fmt:formatNumber type="number" value="${sum7 }" maxFractionDigits="2"/></td>
						<td>${sum8 }</td>
						<td><fmt:formatNumber type="number" value="${sum9 }" maxFractionDigits="2"/></td>
						<td>${sum10 }</td>
						<td><fmt:formatNumber type="number" value="${sum11 }" maxFractionDigits="2"/></td>
						<td>${sum12 }</td>
						<td><fmt:formatNumber type="number" value="${sum13 }" maxFractionDigits="2"/></td>
						<td>${sum14 }</td>
						<td><fmt:formatNumber type="number" value="${sum15 }" maxFractionDigits="2"/></td>
						<td>${sum16 }</td>
						<td><fmt:formatNumber type="number" value="${sum17 }" maxFractionDigits="2"/></td>
						<td>${sum18 }</td>
						<td><fmt:formatNumber type="number" value="${sum19 }" maxFractionDigits="2"/></td>
						<td>${sum20 }</td>
						<td><fmt:formatNumber type="number" value="${sum21 }" maxFractionDigits="2"/></td>
						<td>${sum22 }</td>
						<td><fmt:formatNumber type="number" value="${sum23 }" maxFractionDigits="2"/></td>
						<td>${sum24 }</td>
						<td><fmt:formatNumber type="number" value="${sum25 }" maxFractionDigits="2"/></td>
						<td>${sum26 }</td>
						<td><fmt:formatNumber type="number" value="${sum27 }" maxFractionDigits="2"/></td>
						<td>${sum28 }</td>
						<td><fmt:formatNumber type="number" value="${sum29 }" maxFractionDigits="2"/></td>
					</tr>
				</c:if>	
			</table>
			</div>
			</div>
</div>
</div>
</body>
</html>